#include"commm.hpp"

int main(){
    //从键盘写数据到文件缓冲区
    int wfd = open(NAMED_PIPE,O_WRONLY);
    if(wfd < 0){
        exit(1);
    }

    //开始写数据
    char buffer[1024];
    while(true){
        cout<<"Please Say# ";
        fgets(buffer,sizeof(buffer),stdin);
        ssize_t n = write(wfd,buffer,strlen(buffer));
        assert(n == strlen(buffer));
        (void)n;
    }

    close(wfd);
    
    return 0;
}
